package com.test.expandablegridview;

import java.util.ArrayList;
import java.util.List;

/**
 * Author: dengdayi
 * Date: 2015/9/17 16:13
 * Description:
 */
public class Uitl {
    public static List<List<GroupModel>> getList() {
        List<GroupModel> groupModels = new ArrayList<>();
        for (int i = 1; i <=18; i++) {
            //数据一
            GroupModel groupModel = new GroupModel();
            groupModel.setGroupName("三亚"+(i-1));
            List<ChildModel> childModels = new ArrayList<>();
            ChildModel childModel1 = new ChildModel("福建融信海上城"+(i-1));
            ChildModel childModel2 = new ChildModel("大理苍海高尔夫国际社区"+(i-1));
            ChildModel childModel3 = new ChildModel("厦门海边踏浪客栈"+(i-1));
            ChildModel childModel4 = new ChildModel("万达西双版纳国际旅游度假区"+(i-1));
            ChildModel childModel5 = new ChildModel("信和银湖天峰"+(i-1));
            childModels.add(childModel1);
            childModels.add(childModel2);
            childModels.add(childModel3);
            childModels.add(childModel4);
            childModels.add(childModel5);
            groupModel.setChildModels(childModels);
            groupModels.add(groupModel);
        }

        List<List<GroupModel>> listList=new ArrayList<>();
        for (int i=0;i<groupModels.size();i=i+3){
            List<GroupModel> groups=new ArrayList<>();
            groups.add(groupModels.get(i));
            groups.add(groupModels.get(i+1));
            groups.add(groupModels.get(i+2));
            listList.add(groups);
        }
        return listList;
    }


    public static List<GroupModel> getList2() {
        List<GroupModel> groupModels = new ArrayList<>();
        for (int i = 1; i <=15; i++) {
            //数据一
            GroupModel groupModel = new GroupModel();
            groupModel.setGroupName("三亚"+(i-1));
            List<ChildModel> childModels = new ArrayList<>();
            ChildModel childModel1 = new ChildModel("福建融信海上城"+(i-1));
            ChildModel childModel2 = new ChildModel("大理苍海高尔夫国际社区"+(i-1));
            ChildModel childModel3 = new ChildModel("厦门海边踏浪客栈"+(i-1));
            ChildModel childModel4 = new ChildModel("万达西双版纳国际旅游度假区"+(i-1));
            ChildModel childModel5 = new ChildModel("信和银湖天峰"+(i-1));
            childModels.add(childModel1);
            childModels.add(childModel2);
            childModels.add(childModel3);
            childModels.add(childModel4);
            childModels.add(childModel5);
            groupModel.setChildModels(childModels);
            groupModels.add(groupModel);
        }
        return groupModels;
    }
}
